package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.common.exception.LyException;
import com.leyou.entity.SpecParam;
import com.leyou.item.mapper.SpecParamMapper;
import com.leyou.item.service.SpecParamService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SpecParamServiceImpl extends ServiceImpl<SpecParamMapper, SpecParam> implements SpecParamService {
    @Override
    public List<SpecParam> querybyparam(Long id, Long gid,Boolean rear) {
       if (id==null&&gid==null){
           throw new LyException(400,"查询条件不能为空~~~~·");
       }
        List<SpecParam> list = this.query().eq(id!=null,"category_id", id)
                .eq(gid!=null,"group_id", gid)
                .eq(rear!=null,"searching", rear)
                .list();
       return list;

    }
}